package com.decent.redis.controller;

import com.alibaba.fastjson.JSONObject;
import com.decent.redis.entity.TestEntity;
import com.decent.redis.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.xml.transform.Result;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping(value = "/test")
public class TestController {

    @Autowired
    TestService testService;

    @GetMapping(value = "/hello")
    public Map<String,Object> hello(){

        Map<String,Object> map=new HashMap<>();
        map.put("hello","first");
        map.put("boolean","true");

        return map;
    }

    @GetMapping(value = "/getData")
    public List<TestEntity> getData(){

        return testService.getTestValue();
    }


}
